package com.bw.controller;

import com.bw.bean.Vo;
import com.bw.bean.Vo1;
import com.bw.service.InfoService;
import com.sugar.SugarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
public class InfoController {
    @Autowired
    InfoService infoService;

    @RequestMapping("cx1")
    private Map t1()
    {
       Double a1=infoService.t1();
       return SugarUtil.getFlipNumberData(a1);
    }

    @RequestMapping("cx2")
    private Map t2()
    {
        List<Vo> list =infoService.t2();
        return SugarUtil.getBarData(list);
    }

    @RequestMapping("cx3")
    private Map t3()
    {
        List<Vo> list =infoService.t3();
        return SugarUtil.getPieData(list);
    }

    @RequestMapping("cx4")
    private Map t4()
    {
        List list=new ArrayList();
        list.add("啊");
        list.add("啊1");
        list.add("啊11");
        List<Vo1> list1 =infoService.t4();
        return SugarUtil.getTablePlayData(list,list1);
    }

    @RequestMapping("cx5")
    private Map t5()
    {
        List<Vo> list =infoService.t5();
        return SugarUtil.getBarData(list);
    }

    @RequestMapping("cx6")
    private Map t6()
    {
        List<Vo> list =infoService.t6();
        return SugarUtil.getPieData(list);
    }


    @RequestMapping("cx7")
    private Map t7()
    {
        List<Vo> list =infoService.t7();
        return SugarUtil.getPieData(list);
    }


    @RequestMapping("cx8")
    private Map t8()
    {
        List list=new ArrayList();
        list.add("啊2");
        list.add("啊12");
        list.add("啊112");
        List<Vo1> list1 =infoService.t8();
        return SugarUtil.getTablePlayData(list,list1);
    }
}
